<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:t="http://myfaces.apache.org/tomahawk">
	
	
<body> 
 <ui:composition template="/templates/default/template.xhtml">
    <ui:define name="body">
    <h:form id="taomoidoanra" enctype="multipart/form-data">    
    <h:panelGrid columns="1" style="margin-left:5px;width:100%">
    	<!--  tieu de -->
    	<h:panelGrid columns="3" styleClass="columPanelbaritemTitle">
					<h:graphicImage value="/templates/default/images/left-heading_01.jpg" style="margin-left:-4px;margin-bottom:0px"></h:graphicImage>
			  		<h:outputText value="Thêm mới hộ chiếu" styleClass="panelbaritemTitle"></h:outputText>
					<h:graphicImage value="/templates/default/images/left-heading_03.jpg"></h:graphicImage>
		 </h:panelGrid>
	  	<!-- ket thuc tieu de -->
		<!-- phan noi dung phia duoi -->	  
    	<h:panelGrid columns="1" styleClass="panelGridBody">
    			<!-- Bat dau noi dung ben trong -->
		    <rich:panel style="background:#FFFFFF">
		    	<h:panelGrid columns="1" style="margin-left:13px;">
		       		<h:outputText id="idError" value="#{hoChieu.error}" style=" color: red;"></h:outputText>
				</h:panelGrid>
				<h:outputText value="Thông tin cá nhân" style=" color: red;"></h:outputText>
				<h:panelGrid columns="2" style="margin-left:13px;">
		     		<h:outputText value="Tên(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="ten" value="#{hoChieu.ten}" style="margin-left:20px;"  size="20"/>
		    		
		    		<h:outputText value="CMND(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="cmnd" value="#{hoChieu.cmnd}" style="margin-left:20px;" size="10">
		    		<a4j:support event="onblur" reRender="ten" 
						action="#{hoChieu.checkCMND}"/>
		    		</h:inputText>
		    		
		    		
		    		<h:outputText value="Năm sinh(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		    		<h:inputText id="namSinh" value="#{hoChieu.namSinh}" style="margin-left:20px;" size="8"/>
		    	
		    		<h:outputText value="Giới tính:  " style="margin-left:20px;"  styleClass="inputText" ></h:outputText>
		    		<h:selectOneMenu value="#{hoChieu.gioiTinh}"  style="margin-left:20px;" styleClass="InputControl">
				    <f:selectItems  value="#{hoChieu.listGioiTinh}"/>	
		    		</h:selectOneMenu>	
		    		   		
		       		<h:outputText value="Cơ quan(*) :" style="margin-left:20px;" styleClass="inputText" >
		       		</h:outputText>
		       	  	<h:inputText id="coQuan" value="#{hoChieu.coQuan}" style="margin-left:20px;" size="45"/>
		    	  		    	
		       		<h:outputText value="Chức vụ(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		       		<h:inputText id="chucVu" value="#{hoChieu.chucVu}" style="margin-left:20px;" size="45"/>
				     
					<h:outputText value="Đảng viên: "  styleClass="inputText" style="margin-left:20px;"></h:outputText>
		    		<h:selectBooleanCheckbox style="margin-left:20px;" value="#{hoChieu.dangVien}">
               		</h:selectBooleanCheckbox>
    			
    				<h:outputText></h:outputText>
               		<h:graphicImage value="#{hoChieu.pathImage}" style="margin-left:20px;" alt="" width="80px"></h:graphicImage>
               		
    			</h:panelGrid>
    			
    			<h:panelGrid columns="3" style="margin-left:13px;">
		     		<h:outputText value="Ảnh(*): "  styleClass="inputText" style="margin-left:20px;"></h:outputText>
	           		<t:inputFileUpload type="file" value="#{hoChieu.fileAnh}" style="margin-left:48px;" name="fileName"></t:inputFileUpload>
	           		<t:commandButton value="Xem thử" styleClass="Button" action="#{hoChieu.xemThu}">
					</t:commandButton>
               	</h:panelGrid>		
				<h:outputText value="Thông tin hộ chiếu" style=" color: red;"></h:outputText>
				<h:panelGrid columns="2" style="margin-left:13px;">
				   
				   <h:outputText value="Loại HC(*): " 
				   
				   style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		       	   <h:selectOneMenu value="#{hoChieu.loaiHC}"  styleClass="InputControl">
				    <f:selectItems  value="#{hoChieu.listLoaiHC}"/>	
		    		</h:selectOneMenu>	
				   
				   <h:outputText value="Ngày cấp(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		       	    <h:inputText id="ngayCap" readonly="true" value="#{hoChieu.ngayCap}" size="20"/>
		       	 
					
					<h:outputText value="Ngày hết hạn(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					 <h:inputText id="ngayHetHan" readonly="true" value="#{hoChieu.ngayHetHan}" size="20"/>
		       	 
					<h:outputText value="Nơi cấp(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		       	   <h:inputText id="noiCap" value="#{hoChieu.noiCap}" size="45"/>
				</h:panelGrid>
		     	
		     	<h:outputText value="Thông tin vị trí lưu trữ" style=" color: red;"></h:outputText>
				<h:panelGrid columns="3" style="margin-left:13px;">
					<h:outputText value="Mã tủ lưu trữ(*): " style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		       	   	<h:selectOneMenu value="#{hoChieu.maTu}" style="margin-left:0px;" styleClass="InputControl">
				    	<f:selectItems  value="#{truyXuatViTriTu.listItemViTriTu}">				    
				    	</f:selectItems>	
				    	<a4j:support event="onchange" reRender="idoutHC" 
						action="#{hoChieu.locTheoTuDungHC}"/>
		    		</h:selectOneMenu>	
		    		<a4j:commandButton value="Thêm" styleClass="Button" action="themvitriluutru">
					</a4j:commandButton>
		       	</h:panelGrid>    
		       	 <h:panelGrid columns="2" style="margin-left:13px;">
				   <h:outputText value="Ngăn tủ(*): " id="idoutHC" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
		       	   <h:selectOneMenu value="#{hoChieu.nganTu}" styleClass="InputControl">
				   <f:selectItems  value="#{hoChieu.listNganTu}"/>	
		    		</h:selectOneMenu>
		       	    
				   <h:outputText value="Trạng thái HC: "  styleClass="inputText" style="margin-left:20px;"></h:outputText>
		    		<h:selectOneMenu value="#{hoChieu.trangThaiHC}" styleClass="InputControl">
				    <f:selectItems  value="#{hoChieu.listTrangThaiTraNhan}"/>	
		    		</h:selectOneMenu>	
		    	
		    	
		    	  <h:outputText value="Mô tả: "  styleClass="inputText" style="margin-left:20px;"></h:outputText>
		    	  <h:inputTextarea value="#{hoChieu.moTa}" style="margin-left:8px;" rows="2" cols="34" ></h:inputTextarea>
		    	        		
				</h:panelGrid>
				<h:panelGrid columns="2" style="margin-left:190px;margin-top:10px;margin-bottom:1px">
			    	<t:commandButton value="Tạo Hộ Chiếu" size="15" styleClass="Button" action="#{hoChieu.taoHoChieu}">
			    	</t:commandButton>			    
		       		<t:commandButton type="Button" size="15" value="Hủy" styleClass="Button" action="#{hoChieu.huyTaoHC}"></t:commandButton>
			      	</h:panelGrid>	
			         
		</rich:panel>		
	 </h:panelGrid>
   </h:panelGrid>
   </h:form>
 </ui:define>
</ui:composition> 
</body>	
</html>